package cn.elwy.rcp.ui.table.adapter;

import org.eclipse.core.runtime.IAdapterFactory;

@SuppressWarnings("rawtypes")
public class TreeNodeAdapterFactory implements IAdapterFactory {

  private static final Class[] types = new Class[] { TreeNodeLabelAdapter.class, TreeNodeContentAdapter.class,
      TreeNodeStyleAdapter.class };

  @Override
  public Object getAdapter(Object adapter, Class clazz) {
    if (clazz == TreeNodeContentAdapter.class) {
      return new TreeNodeContentAdapterImpl();
    }
    if (clazz == TreeNodeLabelAdapter.class) {
      return new TreeNodeLabelAdapterImpl();
    }
    if (clazz == TreeNodeStyleAdapter.class) {
      return new TreeNodeStyleAdapterImpl();
    }
    return null;
  }

  @Override
  public Class[] getAdapterList() {
    return types;
  }

}